<template>
	<view class="max-box">
		<view class="checkout-header" @click="deliveryAddress">
			<view class="header-left">
				<u-icon name="map" size="28"></u-icon>
				<view class="information">
					<view class="username">谢 17320825895</view>
					<view class="address">河北省 邢台市 南和县 河郭乡 南豆村 52号</view>
				</view>
			</view>
			<view class="">
				<u-icon name="arrow-right" size="28"></u-icon>
			</view>
		</view>
		<view class="checkout-main">
			<view class="main-title">官方自营综合店</view>
			<u-line type="info"></u-line>
			<view class="main-commodity">
				<image src="/static/logo.png" class="commodity-image" mode=""></image>
				<view class="commodity-introduce">
					<view class="commodity-name">iphone12mini</view>
					<view class="commodity-model">黑色,64GB</view>
					<view class="price-quantity">
						<view class="price-color">
							<text>￥</text>
							<text class="price">4369</text>
							<view class="member-price">
								<view class="member">会员价</view>
								<text class="current-price">￥50</text>
							</view>
						</view>
						<view class="">x1</view>
					</view>
				</view>
			</view>
			<view class="store-coupons">
				<view class="">店铺优惠卷</view>
				<view class="store-coupons-right">
					<view class="">请选择</view>
					<u-icon name="arrow-right" color="#ACACAC" size="20"></u-icon>
				</view>
			</view>
			<view class="shipping-methods">
				<view class="">
					配送方式
					<text class="courier-fee">快递费￥0</text>
				</view>
				<view class="shipping-methods-right">
					<view class="">快递发货</view>
					<u-icon name="arrow-right" color="#ACACAC" size="20"></u-icon>
				</view>
			</view>
			<view class="buyers-message">
				<view class="message-name">
					配送方式
					<input class="courier-fee" type="text" placeholder="请添加备注(150字以内)" v-model="iptData" />
				</view>
			</view>
			<view class="commodity-price">
				<text>共1件，合计: </text>
				<text class="total">￥
					<text class="total-price">4369</text>
				</text>
			</view>
		</view>
		<view class="footer">
			<view class="footer-total">
				合计: 
				<text class="footer-total-price">￥
					<text class="footer-price">4369</text>
				</text>
			</view>
			<view class="submit-order" @click="submitOrder">提交订单</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				// 输入框绑定数据
				iptData:'',
			}
		},
		methods: {
			// 跳转收货地址页面
			deliveryAddress(){
				uni.navigateTo({
					url:'/pages/index/deliveryAddress/deliveryAddress'
				})
			},
			// 跳转提交订单页面
			submitOrder(){
				uni.navigateTo({
					url:'/pages/index/submitOrder/submitOrder'
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.max-box {
		height: 1440rpx;
		background-color: #F6F6F6;
		padding: 20rpx;
	}

	.checkout-header {
		display: flex;
		justify-content: space-between;
		align-items: center;
		background-color: #fff;
		padding: 20rpx 0rpx 20rpx 20rpx;
	}

	.header-left {
		display: flex;
		align-items: center;

		.information {
			margin-left: 20rpx;

			.username {
				font-size: 35rpx;
			}

			.address {
				font-size: 30rpx;
				margin-top: 20rpx;
				color: #898989;
			}
		}
	}

	.checkout-main {
		margin-top: 20rpx;
		padding: 20rpx 0rpx 20rpx 0rpx;
		background-color: #fff;

		.main-title {
			margin: 20rpx;
			font-weight: bold;
		}

		.main-commodity {
			margin: 20rpx;
			display: flex;
			align-items: center;

			.commodity-image {
				width: 210rpx;
				height: 210rpx;
				border-radius: 20rpx;
			}

			.commodity-introduce {
				margin-left: 20rpx;

				.commodity-model {
					margin-top: 20rpx;
					color: #ACACAC;
				}

				.price-quantity {
					width: 100%;
					margin: 20rpx 20rpx 20rpx 0rpx;
					display: flex;
					justify-content: space-between;
					align-items: center;

					.price-color {
						color: red;
						display: flex;
						align-items: center;

						.price {
							font-size: 40rpx;
						}

						.member-price {
							background-color: #FFE9BA;
							display: flex;
							margin-left: 20rpx;
						}

						.member {
							background-color: black;
							color: #FFCC22;
							text-align: center;
							padding: 5rpx 20rpx 5rpx 20rpx;
							font-size: 30rpx;
						}

						.current-price {
							padding: 10rpx 10rpx 10rpx 10rpx;
							font-size: 25rpx;

							width: 70rpx;
							position: relative;

							&::before,
							&::after {
								content: ' ';
								position: absolute;
							}

							&::after {
								top: 50%;
								left: -28rpx;
								transform: translate(50%, -50%);
								width: 30rpx;
								height: 30rpx;
								border-radius: 50%;
								background-color: #FFE9BA;
							}
						}
					}
				}
			}
		}
	}

	.store-coupons {
		margin: 20rpx;
		display: flex;
		justify-content: space-between;
		align-items: center;

		.store-coupons-right {
			display: flex;
			align-items: center;
			color: #ACACAC;
		}
	}

	.shipping-methods {
		margin: 50rpx 20rpx 20rpx 20rpx;
		display: flex;
		justify-content: space-between;
		align-items: center;

		.shipping-methods-right {
			display: flex;
			align-items: center;
		}

		.courier-fee {
			margin-left: 20rpx;
			color: #C5C5C5;
		}
	}
	.buyers-message{
		margin: 50rpx 20rpx 20rpx 20rpx;
		display: flex;
		justify-content: space-between;
		align-items: center;
		.message-name{
			display: flex;
			align-items: center;
		}
		.courier-fee {
			margin-left: 20rpx;
			color: #C5C5C5;
		}
	}
	.commodity-price{
		display: flex;
		align-items: center;
		margin-left: 55%;
		.total{
			color: red;
			.total-price{
				font-size: 45rpx;
			}
		}
	}
	.footer{
		width: 100%;
		position: fixed;
		bottom: 0;
		padding: 20rpx 30rpx 20rpx 30rpx;
		background-color: #fff;
		display: flex;
		justify-content: space-between;
		align-items: center;
		.footer-total{
			font-size: 40rpx;
			.footer-total-price{
				font-size: 30rpx;
				.footer-price{
					font-size: 40rpx;
					color: red;
				}
			}
		}
		.submit-order{
			margin-right: 80rpx;
			background-color: #FE323B;
			color: #fff;
			border-radius: 40rpx;
			padding: 20rpx 60rpx 20rpx 60rpx;
		}
	}
</style>